from domain import Domain
from numpy import array, linspace, append
from elements import RodElement

x = linspace(0.0,1.0, 10)

mydomain = Domain()

for n in range(x.size):
    mydomain.add_node(mydomain.Node(n+1, coordinates=array([x[n],0.0])))    
    
lengths = array([])
area = 10.0
youngs_modulus = 30e6

for n in range(1,x.size):
    length = x[n] - x[n-1]
    element_nodes = [mydomain.nodes[n], mydomain.nodes[n+1]]
    r = RodElement(n, youngs_modulus, area, length, element_nodes)
    mydomain.add_element(r)

for element_id in mydomain.elements:
    mydomain.elements[element_id].print_debug_info()

